package com.wc.AlgoOJ_train.train1.c4.A417;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/1/10 18:30
 * @description find your present
 * http://43.138.190.70:8888/p/A417
 */
public class Main {
    static FastReader sc = new FastReader();

    public static void main(String[] args) {
        while (true) {
            int n = sc.nextInt();
            if (n == 0) {
                return;
            }
            int ans = sc.nextInt();
            while (--n > 0) {
                ans ^= sc.nextInt();
            }
            System.out.println(ans);
        }
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }
}
